\hypertarget{main_8c}{
\section{main.c File Reference}
\label{main_8c}\index{main.c@{main.c}}
}
{\ttfamily \#include $<$avr/interrupt.h$>$}\par
{\ttfamily \#include $<$avr/io.h$>$}\par
{\ttfamily \#include $<$stdint.h$>$}\par
{\ttfamily \#include \char`\"{}FreeRTOS.h\char`\"{}}\par
{\ttfamily \#include \char`\"{}task.h\char`\"{}}\par
{\ttfamily \#include \char`\"{}nxbot.h\char`\"{}}\par
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{main_8c_a840291bc02cba5474a4cb46a9b9566fe}{main} (void)
\begin{DoxyCompactList}\small\item\em The main function. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
xTaskHandle \hyperlink{main_8c_a530db8c8f5d4566f119839f2521d3f56}{commHandle}
\begin{DoxyCompactList}\small\item\em The handle for the communication task. \item\end{DoxyCompactList}\item 
xTaskHandle \hyperlink{main_8c_a6e4a3ffc616e13ac5f975a87d8b969ee}{soundHandle}
\begin{DoxyCompactList}\small\item\em The handle for the sound task. \item\end{DoxyCompactList}\item 
xTaskHandle \hyperlink{main_8c_a76d3eb261196f8d460dbe05cdc0eae6f}{sensorHandle}
\begin{DoxyCompactList}\small\item\em The handle for the sensor task. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{main_8c_a840291bc02cba5474a4cb46a9b9566fe}{
\index{main.c@{main.c}!main@{main}}
\index{main@{main}!main.c@{main.c}}
\subsubsection[{main}]{\setlength{\rightskip}{0pt plus 5cm}int main (void)}}
\label{main_8c_a840291bc02cba5474a4cb46a9b9566fe}


The main function. It initializes all the hardware of the robot and creates the structure used to pass information and data between tasks. All the tasks are instantiated and the control is given to the scheduler. 

\subsection{Variable Documentation}
\hypertarget{main_8c_a530db8c8f5d4566f119839f2521d3f56}{
\index{main.c@{main.c}!commHandle@{commHandle}}
\index{commHandle@{commHandle}!main.c@{main.c}}
\subsubsection[{commHandle}]{\setlength{\rightskip}{0pt plus 5cm}xTaskHandle {\bf commHandle}}}
\label{main_8c_a530db8c8f5d4566f119839f2521d3f56}


The handle for the communication task. This task handles all the communication through the serial port (UART1). It is declared as a global variable, in order to use it in other modules of the firmware. \hypertarget{main_8c_a76d3eb261196f8d460dbe05cdc0eae6f}{
\index{main.c@{main.c}!sensorHandle@{sensorHandle}}
\index{sensorHandle@{sensorHandle}!main.c@{main.c}}
\subsubsection[{sensorHandle}]{\setlength{\rightskip}{0pt plus 5cm}xTaskHandle {\bf sensorHandle}}}
\label{main_8c_a76d3eb261196f8d460dbe05cdc0eae6f}


The handle for the sensor task. This task is in charge of updating all the data coming from the sensors and organize it in their respective structures declared in \hyperlink{structures_8h}{structures.h}. It is declared as a global variable, in order to use it in other modules of the firmware. \hypertarget{main_8c_a6e4a3ffc616e13ac5f975a87d8b969ee}{
\index{main.c@{main.c}!soundHandle@{soundHandle}}
\index{soundHandle@{soundHandle}!main.c@{main.c}}
\subsubsection[{soundHandle}]{\setlength{\rightskip}{0pt plus 5cm}xTaskHandle {\bf soundHandle}}}
\label{main_8c_a6e4a3ffc616e13ac5f975a87d8b969ee}


The handle for the sound task. This task is always suspended and only activated by the communication task. It handles the timing for the musical notes. It is declared as a global variable, in order to use it in other modules of the firmware. 